/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.carrito.jdbc.dao;

import com.carrito.jsf.persistence.Login;
import java.util.List;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author oscarc
 */
public class ImplLogin extends HibernateDaoSupport implements IfaceLogin {
    
   
    public Login validaLogin(Login obj){
        System.out.println("validaLogin!!!!!!!!!!!!!!!!!!!");
        List<Login> lista = getHibernateTemplate().find("FROM Login AS o WHERE o.password = ?",obj.getPassword());
        
        if (lista.size() > 0) {
            return lista.get(0);
        }
        return null;
    }
}
